package com.yf.dxapp.module.app.dal.mysql.appnotice;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import com.yf.dxapp.module.app.controller.admin.appnotice.vo.AppNoticePageReqVO;
import com.yf.dxapp.module.app.dal.dataobject.appnotice.AppNoticeDO;
import org.apache.ibatis.annotations.Mapper;

/**
 * 通知公告 Mapper
 *
 * @author 芋道源码
 */
@Mapper
public interface AppNoticeMapper extends BaseMapperX<AppNoticeDO> {

    default PageResult<AppNoticeDO> selectPage(AppNoticePageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<AppNoticeDO>()
                .eqIfPresent(AppNoticeDO::getTitle, reqVO.getTitle())
                .eqIfPresent(AppNoticeDO::getContent, reqVO.getContent())
                .eqIfPresent(AppNoticeDO::getPicture, reqVO.getPicture())
                .eqIfPresent(AppNoticeDO::getStatus, reqVO.getStatus())
                .betweenIfPresent(AppNoticeDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(AppNoticeDO::getId));
    }

}